set(CMAKE_VERBOSE_MAKEFILE "on")
cmake_minimum_required(VERSION 3.18)
project(aegaeon_native LANGUAGES CXX CUDA)
cmake_policy(SET CMP0148 NEW)
cmake_policy(SET CMP0146 NEW)
set(CMAKE_CXX_STANDARD 17)
#set(CMAKE_CXX_COMPILER /usr/bin/g++)

execute_process(
    COMMAND pybind11-config --cmakedir
    OUTPUT_VARIABLE PYBIND11_CMAKE_DIR
    OUTPUT_STRIP_TRAILING_WHITESPACE
)
list(APPEND CMAKE_PREFIX_PATH ${PYBIND11_CMAKE_DIR})
message(STATUS "pybind11 CMake directory: ${PYBIND11_CMAKE_DIR}")
find_package(pybind11 REQUIRED)
#set(CUDA_TOOLKIT_ROOT_DIR "/usr/local/cuda")
#find_package(CUDA REQUIRED)
find_package(CUDAToolkit REQUIRED)
include_directories(${PROJECT_SOURCE_DIR}/include)
pybind11_add_module(aegaeon_native
    src/python_bindings.cpp
    src/allocator.cpp
    src/pinned_pool.cpp
    src/ipc_event.cpp
    src/kvcache.cpp
)

#target_include_directories(aegaeon_native PRIVATE ${CUDA_INCLUDE_DIRS})
target_link_libraries(aegaeon_native PRIVATE CUDA::cudart)
